using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Globalization;


public partial class webadmin_pages_DanhMuc_DanToc_detail : System.Web.UI.Page
{
    public Common comm = new Common();
    public DataRow catdtr;
    DataTable dtt;
    string sTemp; string id="";
    public string messageError;
    public string sMessage="0";
    public string sDatetime = "",sTTT="";

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["id"])) id = comm.TextFormat(Request.QueryString["id"]).Trim();
                if (!string.IsNullOrEmpty(Request.QueryString["m"])) sMessage = comm.TextFormat(Request.QueryString["m"]).Trim();
                sTemp = "SELECT * FROM DanhMuc_nghiep_vu";
                sTemp += " where ma_nghiep_vu='" + id + "'";
                catdtr = comm.getDataTable(sTemp).Rows[0];
                dtt = comm.getDataTable("SELECT ten_hang FROM DanhMuc_hang as A inner join DanhMuc_hang_nghiep_vu as B on B.ma_hang=A.ma_hang WHERE B.ma_nghiep_vu='" + catdtr["ma_nghiep_vu"] + "'");
                for (int i = 0; i < dtt.Rows.Count-1; i++)
                {
                    sTTT += dtt.Rows[i][0].ToString()+", ";
                }
                sTTT += dtt.Rows[dtt.Rows.Count-1][0].ToString();
                if (!string.IsNullOrEmpty(catdtr["ngay_tao"].ToString()))
                    sDatetime = Convert.ToDateTime(catdtr["ngay_tao"]).ToString("dd/MM/yyyy hh:mm:ss");
            }
        }
        catch (Exception ex)
        {
            messageError = ex.Message.ToString();
        }
        
    }
}
